﻿using System;
using System.Data;
using System.Threading.Tasks;
using DB.SchemaSync.Library.Models;

namespace DB.SchemaSync.Library.Interfaces
{
	public interface IDbConnectionProvider
	{
		/// <summary>
		/// Indicates what object types the provider handles. This property was intended to allow GUI apps to filter
		/// what they present as applicable to a merge opertation, but it turns out I haven't used it, really, so it will
		/// likely be removed
		/// </summary>
		ObjectTypeFlags ObjectTypes { get; }

		Task<Database> GetDatabaseAsync(IDbConnection connection);

        Task<Database> GetDatabaseAsync();

		Func<string, IDbConnection> ConnectionMethod { get; }
		Func<IDbConnection, string, IDbCommand> CommandBuilderMethod { get; }
		Func<IDbCommand, DataColumn, IDbDataParameter> ParameterBuilderMethod { get; }
		Action<IDbDataParameter, DataRow> AssignParamValueAction { get; }

		SqlSyntax GetDefaultSyntax();
	}
}